/*     */ package com.lmpop.trade.ti_showinfo;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.FileIO;
/*     */ import com.lmpop.trade.ts_module.Ts_moduleInfo;
/*     */ import com.lmpop.updateHtml.parseXml.Config;
/*     */ import com.lmpop.updateHtml.updateHtml.UpdateArticleHtml;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_showinfoInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */   FileIO io;
/*     */   Config conf;
/*     */   String rootpath;
/*     */   UpdateArticleHtml uah;
/*     */ 
/*     */   public Ti_showinfoInfo()
/*     */   {
/*  25 */     this.queryList = new QueryList();
/*  26 */     this.uah = new UpdateArticleHtml();
/*  27 */     this.io = new FileIO();
/*  28 */     this.conf = new Config();
/*  29 */     this.conf.init();
/*  30 */     this.rootpath = this.conf.getString("rootpath");
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  38 */     Ti_showinfo ti_showinfo = new Ti_showinfo();
/*  39 */     ti_showinfo.setShow_id(map.getString("show_id"));
/*  40 */     ti_showinfo.setShow_type(map.getString("show_type"));
/*  41 */     ti_showinfo.setCust_id(map.getString("cust_id"));
/*  42 */     ti_showinfo.setTitle(map.getString("title"));
/*  43 */     ti_showinfo.setContent(map.getString("content"));
/*  44 */     ti_showinfo.setShow_addr(map.getString("show_addr"));
/*  45 */     ti_showinfo.setShow_pos(map.getString("show_pos"));
/*  46 */     ti_showinfo.setStart_date(map.getString("start_date"));
/*  47 */     ti_showinfo.setEnd_date(map.getString("end_date"));
/*  48 */     ti_showinfo.setOpen_start_date(map.getString("open_start_date"));
/*  49 */     ti_showinfo.setOpen_end_date(map.getString("open_end_date"));
/*  50 */     ti_showinfo.setMg_unit(map.getString("mg_unit"));
/*  51 */     ti_showinfo.setDo_unit(map.getString("do_unit"));
/*  52 */     ti_showinfo.setHelp_unit(map.getString("help_unit"));
/*  53 */     ti_showinfo.setIn_rage(map.getString("in_rage"));
/*  54 */     ti_showinfo.setFee(map.getString("fee"));
/*  55 */     ti_showinfo.setContact_man(map.getString("contact_man"));
/*  56 */     ti_showinfo.setContact_phone(map.getString("contact_phone"));
/*  57 */     ti_showinfo.setState_code(map.getString("state_code"));
/*  58 */     ti_showinfo.setClass_attr(map.getString("class_attr"));
/*  59 */     ti_showinfo.setArea_attr(map.getString("area_attr"));
/*  60 */     ti_showinfo.setUser_id(map.getString("user_id"));
/*  61 */     ti_showinfo.setRemark(map.getString("remark"));
/*     */ 
/*  63 */     String result_code = "0";
/*     */     try {
/*  65 */       insert(dbmMgr, ti_showinfo);
/*     */     } catch (ApplicationException e) {
/*  67 */       e.printStackTrace();
/*  68 */       result_code = "1";
/*     */     }
/*  70 */     map.setString("result_code", result_code);
/*  71 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_showinfo ti_showinfo)
/*     */     throws ApplicationException
/*     */   {
/*  80 */     dbmMgr.update("insertTi_showinfo", ti_showinfo);
/*     */   }
/*     */ 
/*     */   public SysMap create_alterPage(DbmInterf dbmMgr, SysMap map) {
/*  84 */     this.uah.updateArticleByGoodsId("vX780aH325615d7", map.getString("show_id"), "0", "1");
/*  85 */     return map;
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  93 */     String pkid_string = map.getString("pkid");
/*  94 */     String result_code = "0";
/*  95 */     Ts_moduleInfo moduleInfo = new Ts_moduleInfo();
/*  96 */     String modulepath = moduleInfo.getSavaPathByCode("showinfo");
/*     */     try {
/*  98 */       if (!pkid_string.equals("")) {
/*  99 */         String[] pkStr = pkid_string.split("\\|");
/* 100 */         List list = null;
/* 101 */         String publish_date = "";
/* 102 */         for (int i = 0; i < pkStr.length; i++)
/* 103 */           if (!pkStr[i].equals("")) {
/* 104 */             list = this.queryList.getList("getTi_showinfoByPk", pkStr[i]);
/* 105 */             publish_date = ((Hashtable)list.get(0)).get("in_date").toString();
/* 106 */             publish_date = publish_date.substring(0, 10);
/* 107 */             delete(dbmMgr, pkStr[i]);
/* 108 */             FileIO.DelFile(this.rootpath + modulepath + publish_date + "/" + pkStr[i] + ".html");
/*     */           }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e) {
/* 113 */       e.printStackTrace();
/* 114 */       result_code = "1";
/*     */     }
/* 116 */     map.setString("result_code", result_code);
/* 117 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 126 */     dbmMgr.update("deleteTi_showinfo", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 135 */     Ti_showinfo ti_showinfo = new Ti_showinfo();
/* 136 */     ti_showinfo.setShow_id(map.getString("show_id"));
/* 137 */     ti_showinfo.setShow_type(map.getString("show_type"));
/* 138 */     ti_showinfo.setTitle(map.getString("title"));
/* 139 */     ti_showinfo.setContent(map.getString("content"));
/* 140 */     ti_showinfo.setShow_addr(map.getString("show_addr"));
/* 141 */     ti_showinfo.setShow_pos(map.getString("show_pos"));
/* 142 */     ti_showinfo.setStart_date(map.getString("start_date"));
/* 143 */     ti_showinfo.setEnd_date(map.getString("end_date"));
/* 144 */     ti_showinfo.setOpen_start_date(map.getString("open_start_date"));
/* 145 */     ti_showinfo.setOpen_end_date(map.getString("open_end_date"));
/* 146 */     ti_showinfo.setMg_unit(map.getString("mg_unit"));
/* 147 */     ti_showinfo.setDo_unit(map.getString("do_unit"));
/* 148 */     ti_showinfo.setHelp_unit(map.getString("help_unit"));
/* 149 */     ti_showinfo.setIn_rage(map.getString("in_rage"));
/* 150 */     ti_showinfo.setFee(map.getString("fee"));
/* 151 */     ti_showinfo.setContact_man(map.getString("contact_man"));
/* 152 */     ti_showinfo.setContact_phone(map.getString("contact_phone"));
/* 153 */     ti_showinfo.setState_code(map.getString("state_code"));
/* 154 */     ti_showinfo.setClass_attr(map.getString("class_attr"));
/* 155 */     ti_showinfo.setArea_attr(map.getString("area_attr"));
/* 156 */     ti_showinfo.setUser_id(map.getString("session_user_id"));
/*     */ 
/* 158 */     String result_code = "0";
/*     */     try {
/* 160 */       update(dbmMgr, ti_showinfo);
/* 161 */       this.uah.updateArticleByGoodsId("vX780aH325615d7", map.getString("show_id"), "0", "1");
/*     */     } catch (ApplicationException e) {
/* 163 */       e.printStackTrace();
/* 164 */       result_code = "1";
/*     */     }
/* 166 */     map.setString("result_code", result_code);
/* 167 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_showinfo ti_showinfo)
/*     */     throws ApplicationException
/*     */   {
/* 176 */     dbmMgr.update("updateTi_showinfo", ti_showinfo);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 187 */     Map ti_showinfo = (Hashtable)obj;
/* 188 */     if (start == 0)
/* 189 */       start = 0;
/*     */     else {
/* 191 */       start = (start - 1) * limit;
/*     */     }
/* 193 */     ti_showinfo.put("start", Integer.valueOf(start));
/* 194 */     ti_showinfo.put("limit", Integer.valueOf(limit));
/* 195 */     return this.queryList.getList("getListByTi_showinfoPage", ti_showinfo);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 207 */     Map ti_showinfo = (Hashtable)obj;
/* 208 */     List list = this.queryList.getList("getCountByObjTi_showinfo", ti_showinfo);
/* 209 */     int count = 0;
/* 210 */     if ((list != null) && (list.size() > 0)) {
/* 211 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 212 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 213 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 216 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 226 */     return this.queryList.getList("getTi_showinfoByPk", pk);
/*     */   }
/*     */ 
/*     */   public SysMap upateState(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 236 */     Ti_showinfo ti_showinfo = new Ti_showinfo();
/* 237 */     String pkid_string = map.getString("pkid");
/* 238 */     String state_code = map.getString("up_operating");
/* 239 */     ti_showinfo.setState_code(state_code);
/* 240 */     String result_code = "0";
/*     */     try {
/* 242 */       if (!pkid_string.equals("")) {
/* 243 */         String[] pkStr = pkid_string.split("\\|");
/* 244 */         for (int i = 0; i < pkStr.length; i++)
/* 245 */           if (!pkStr[i].equals("")) {
/* 246 */             ti_showinfo.setShow_id(pkStr[i]);
/* 247 */             upateState(dbmMgr, ti_showinfo);
/*     */           }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/* 253 */       e.printStackTrace();
/* 254 */       result_code = "1";
/*     */     }
/* 256 */     map.setString("result_code", result_code);
/* 257 */     return map;
/*     */   }
/*     */ 
/*     */   public void upateState(DbmInterf dbmMgr, Ti_showinfo ti_showinfo)
/*     */     throws ApplicationException
/*     */   {
/* 266 */     dbmMgr.update("upateShowState", ti_showinfo);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_showinfo.Ti_showinfoInfo
 * JD-Core Version:    0.6.0
 */